import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:liuxlcommon/util/sp_utils.dart';
import 'package:liuxlcommon/view/lxl_widget.dart';
import 'package:liuxlcommon/view/my_box.dart';
import 'package:love_newf/app/com/base/L.dart';
import 'package:love_newf/app/com/base/app.dart';
import 'package:love_newf/app/com/base/base_state.dart';
import 'package:love_newf/value/app_colors.dart';
import 'package:love_newf/value/app_const.dart';

import '../../../../generated/assets.dart';
import '../../../com/view/common_view.dart';
import 'setting_logic.dart';

class SettingPage extends StatefulWidget {
  const SettingPage({Key? key}) : super(key: key);

  @override
  State<SettingPage> createState() => _SettingPageState();
}

class _SettingPageState extends BaseState<SettingPage, SettingLogic> {
  @override
  get initData {
    title = "设置";
    L.userSetting.then((setting) {
      logic.userSettingModel = setting;
      logic.update();
    });
  }

  @override
  Widget get easyBody =>
      LColumn.eazy([
        LColumn.eazy([40.lsh, LImage.easy(Assets.imgLogo, 100.w, 100.w, 10.w)])
            .scroll(isScroll: true)
            .flex(1),
        LText.easy("注销账号", 14.w, fw6, Colors.white)
            .center()
            .radius(22.w)
            .bgColor(AppColors.primaryColor)
            .size(343.w, 44.w).onTapL((){
              CommonView.signOutDialog();
        }),
        16.lsh,
        LText.easy("退出登录", 14.w, fw6, Colors.white)
            .center()
            .radius(22.w)
            .bgColor(AppColors.primaryColor)
            .size(343.w, 44.w).onTapL(() {
          CommonView.commDialog(
              confirm: () {
                Get.back();
                App.logout();
              }, title: "提示", message: "是否退出当前账号！");
        }),
        20.lsh
      ]).size(375.w, null);
}
